import axios from "@/libs/api.request";
// 分页查询
export const getAllList = (page, pageSize) => {
  // return axios.get(url,{})
  return axios.request({
    url: "/jxy/banner/allList",
    method: "get",
    // get数据传参
    params: {
      page,
      pageSize,
    },
  });
};

export const delBanner = (id) => {
  return axios.request({
    url: "/jxy/banner/del",
    method: "post",
    // post数据传参
    data: {
      id,
    },
  });
};
// 更新
export const updateBanner = (id, pushState) => {
  return axios.request({
    url: "/jxy/banner/update",
    method: "post",
    // post数据传参
    data: {
      id,
      pushState,
    },
  });
};

export const createBanner = (link, path) => {
  return axios.request({
    url: "/jxy/banner/create",
    method: "post",
    // post数据传参
    data: {
      link,
      path,
    },
  });
};

// 文件上传
export const fileUpload = (formdata) => {
  return axios.request({
    url: "/jxy/file/upload",
    method: "post",
    // post数据传参
    data: formdata,
  });
};

// http://120.27.139.234:3000/file/upload
